using System;

class BankAccount{
    private String accountid;
    private String name;
    private String opentime;
    private String personid;
    private int balance;
    
    public String openAccount(String name,String personid){
        this.name = name;
        this.personid = personid;
        this.opentime = System.DateTime.Now.ToString("d");
        this.accountid = personid;

        String result = "姓名: " + name + "\n账号: " + personid; 
        return result;
    }
    public String deposit(int deposit){
        if (this.accountid != null) {
            this.balance += deposit;
        } 
        String msg = "存入"+ deposit + ",现余额："+balance;
        return msg;
    }
    public String withdraw(int withdrawal){
        if (this.accountid != null) {
            this.balance -= withdrawal;
        }
        String msg = "取出"+ withdrawal + ",现余额："+balance;
        return msg;
    }
    public String checkBalance(){
        if (this.accountid != null) {
            String msg =  "现余额："+balance;
            return msg;
        }
            return "error";
    }
}